﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace UI.View.Repairs
{
    /// <summary>
    /// List.xaml 的交互逻辑
    /// </summary>
    public partial class Huifang : Page
    {


        ViewModel.RepairViewModel vm;
        
        public Huifang()
        {
            InitializeComponent();
            vm = DataContext as ViewModel.RepairViewModel;

            vm.GetHuifang();
        }

        private async void Btn_Query_Click(object sender, RoutedEventArgs e)
        {
             
            vm.ListRepairs =await vm.Query(txt_RepairID.Text, dtp_StartTime.SelectedDateTime,dtp_EndTime.SelectedDateTime, "已维修");
        }

        private void Btn_CreateRepair_Click(object sender, RoutedEventArgs e)
        {
            //MainWindow.GetMain().Frm.Navigate(new View.Repairs.New());
          vm.Dialog =  HandyControl.Controls.Dialog.Show(new View.Repairs.Part.HuiFang());
        }
    }
}
